#include <walle/common/cmd_line.h>
#include <iostream>

using namespace walle;
using namespace std;
int main(int argc, char**argv) 
{
	walle::CmdParser p;
	p.add<string>("host", 'h', "host name", true, "");
	p.add<int>("port", 'p', "port number", false, 80, range(1, 65535));
	p.add<string>("type", 't', "protocol type", false, "http", oneof<string>("http", "https", "ssh", "ftp"));
	p.add("gzip", 'g', "gzip when transfer");
	p.parse_check(argc, argv);
	std::string schame;
	std::string host;
	int port;
	p.get<string>("type", schame);
	p.get<int>("port", port);
	p.get<std::string>("host", host);
	cout << schame << "://"
 	<< host << ":"<< port<< endl;
	if(p.exist("gzip")) {
		cout<<"compress: gzip enabled"<<endl;
	} else {
		cout<<"compress: gzip disabled"<<endl;	
	}
	return 0;
}